Add post Promise functions#775
Closed
jfcartier wants to merge 3 commits intosignalpoint:8.x-1.xfrom
jfcartier:patch-2
Closed
Add post Promise functions#775jfcartier wants to merge 3 commits intosignalpoint:8.x-1.xfrom jfcartier:patch-2
jfcartier wants to merge 3 commits intosignalpoint:8.x-1.xfrom
jfcartier:patch-2
Conversation
Currently, there's a global postRender process, it works like a charm, but I think there's missing something. A postRender for Promises, like a callback. To justify this proposition, here's a case : Lets say we have an "AddToCalendar" link inside each views row. So when we call theme_view, theres nothing we can do to add an event on each links. Global postRender is of course triggered before the view query. We could add a jQuery ".on()" function on body, but it's not really interesting since my solution here solve that problem. What do you think?
It could be useful to have the views results. We could want to manipulate something with data.attributes or even check what the view's output is to make something if its empty or not.
Contributor
Author
|
Example of usage : {
_theme: 'view',
_path: 'viewspath',
_callback: [function(data){
console.log(data);
}],
_row_callback: function(row) {
}
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, there's a global postRender process and it works like a charm. But I think there's missing something; a postRender for Promises as a callback.
To justify this proposition, here's a case
Lets say we have an "AddToCalendar" link inside each views row.
So when we call theme_view, theres nothing we can do to add an event on each links.
Global postRender is of course triggered before the view query. If jQuery is installed, we could add the ".on()" function on body, but it's not really interesting since my solution solves that problem.
What do you think?